from datetime import datetime
from flask import Flask
from flask_apscheduler import APScheduler

app = Flask(__name__)
app.config['SCHEDULER_API_ENABLED'] = True

scheduler = APScheduler()
scheduler.init_app(app)
scheduler.add_job(func=job_hvpp, id="hvpp_job", trigger="interval", seconds=120, replace_existing=False)


# @scheduler.task('cron', id='auto-ui', second='10')
# def job():
#     with open('job', 'a+')as f:
#         f.write(str(datetime.now()) + "\n")


@app.route('/')
def hello_world():  # put application's code here
    return 'Hello World!'


if __name__ == '__main__':
    scheduler.start()
    app.run()
